package com.example.dailyrecord.util;

import java.security.SecureRandom;

public class PasswordEncoder {
    private static final BCryptPasswordEncoder PASSWORD_ENCODER =
            new BCryptPasswordEncoder(10, new SecureRandom("qUwEjkmZR76iMh253BRYMeizPOKDnI".getBytes()));

    public static BCryptPasswordEncoder getEncoder() {
        return PASSWORD_ENCODER;
    }

    public static String encoder(String str) {
        return PASSWORD_ENCODER.encode(str);
    }

    public static boolean matches(String s1, String s2) {
        return PASSWORD_ENCODER.matches(s1, s2);
    }


}
